-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Add mode display indicators on task cards (#6493) #6501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add mode display indicators on task cards (#6493) #6501
Conversation
- Created ModeBadge component to display mode names with proper styling - Updated TaskItemHeader to show mode badge next to timestamp in history view - Updated TaskHeader to display mode badge in main chat view - Added comprehensive unit tests for ModeBadge component - Handles custom modes, deleted modes, and long mode names with truncation - Only displays badge when mode information exists (no empty badges)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! I've reviewed the changes and found some issues that need attention. The implementation correctly addresses the issue requirements and includes comprehensive testing, but there are import path and styling concerns that should be addressed.
| @@ -0,0 +1,42 @@ | |||
| import React from "react" | |||
| import { getModeBySlug } from "@roo/modes" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import path inconsistency detected. This uses while the rest of the codebase uses or patterns. Could we update this to match the project's import conventions?
| const displayName = mode?.name || modeSlug | ||
|
|
||
| // Truncate long mode names | ||
| const truncatedName = displayName.length > 20 ? `${displayName.substring(0, 17)}...` : displayName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hard-coded truncation logic (20 characters, 17 + "...") might not work well for all languages or use cases. Could we consider making this configurable or using CSS for better performance and consistency?
| <StandardTooltip content={displayName}> | ||
| <Badge | ||
| variant="outline" | ||
| className={cn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The styling overrides here conflict with the Badge variant's default styling. This could break visual consistency across the app. Is there a way to work with the existing Badge variants instead of overriding them?
| const mode = getModeBySlug(modeSlug, customModes) | ||
|
|
||
| // If mode is not found (e.g., deleted custom mode), show the slug as fallback | ||
| const displayName = mode?.name || modeSlug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback to showing the raw slug might be confusing for users. Could we consider a more user-friendly fallback like "Unknown mode" or hide the badge entirely for deleted modes?
| // Mock dependencies | ||
| vi.mock("@roo/modes") | ||
| vi.mock("@/context/ExtensionStateContext") | ||
| vi.mock("@/components/ui", () => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mocking the entire module could be brittle. Could we consider more targeted mocks for just the components we need to test?
Description
Fixes #6493
This PR adds mode display indicators to task cards in both the main chat screen and history view, allowing users to quickly identify which mode was used for each task.
Changes Made
ModeBadgecomponent that displays mode names with proper VSCode theme stylingTaskItemHeaderto show mode badge next to timestamp in history viewTaskHeaderto display mode badge in main chat header areaTesting
Verification of Acceptance Criteria
Checklist
Screenshots/Demo
History View
Mode badges now appear next to the timestamp on task cards in the history view.
Main Chat View
Mode badge displays in the task header area, making it easy to see which mode is being used for the current task.
The implementation handles all edge cases including deleted custom modes (shows slug as fallback), long mode names (truncates with ellipsis), and ensures no empty badges appear for legacy tasks without mode data.
Important
Add
ModeBadgecomponent to display mode indicators on task cards in main chat and history views, with comprehensive testing.ModeBadgecomponent inModeBadge.tsxto display mode names with VSCode theme styling.TaskHeader.tsxto includeModeBadgenext to the timestamp in the main chat view.TaskItemHeader.tsxto includeModeBadgein the history view.ModeBadgeinModeBadge.spec.tsxcovering scenarios like long names, missing data, and custom classes.This description was created by
for f258f49. You can customize this summary. It will automatically update as commits are pushed.